<script>
import { getShowNginxPicUrl } from "@/utils/settings"

export default {
  name: "scanQrcodePopup",
  data() {
    return {
      link: "",
    }
  },
  methods: {
    getShowNginxPicUrl,
    open(link) {
      this.link = link
      this.$refs.popup.open()
    },
  },
}
</script>

<template>
  <uni-popup ref="popup" type="center" :is-mask-click="false">
    <view class="popup-content">
      <image class="qr-code" mode="widthFix" :show-menu-by-longpress="true" :src="getShowNginxPicUrl(link)"></image>
      <view class="confirm-btn" @click="() => $refs.popup.close()">我已扫描以上二维码</view>
    </view>
  </uni-popup>
</template>

<style scoped lang="scss">
.popup-content {
  background: white;
  border-radius: 20rpx;
  padding: 20rpx;
  > .qr-code {
    width: 90vw;
  }
  > .confirm-btn {
    padding-top: 20rpx;
    font-size: 30rpx;
    color: var(--text-color-theme);
    text-align: center;
  }
}
</style>
